package day07.testTwo;

public class House {
    private int layers;
    private int area;

    public House() {

    }

    public House(int layers, int area) {
        this.layers = layers;
        this.area = area;
    }

    public int getLayers() {
        return layers;
    }

    public void setLayers(int layers) {
        this.layers = layers;
    }

    public int getArea() {
        return area;
    }

    public void setArea(int area) {
        this.area = area;
    }

    public void show() {
        System.out.println("层数：" + layers + ",总面积：" + area);
    }
}

class Residence extends House {
    private int bedroom;
    private int bathroom;

    public Residence(int bedroom, int bathroom) {
        this.bedroom = bedroom;
        this.bathroom = bathroom;
    }

    public Residence(int layers, int area, int bedroom, int bathroom) {
        super(layers, area);
        this.bedroom = bedroom;
        this.bathroom = bathroom;
    }

    public void show() {
        System.out.print("住宅：层数：" + getLayers() + ",总面积：" + getArea());
        System.out.println("卧室数：" + bedroom + ",浴室数：" + bathroom);
    }

    public int getBedroom() {
        return bedroom;
    }

    public void setBedroom(int bedroom) {
        this.bedroom = bedroom;
    }

    public int getBathroom() {
        return bathroom;
    }

    public void setBathroom(int bathroom) {
        this.bathroom = bathroom;
    }
}

class Office extends House {
    private int room;
    private int nofire;

    public Office(int room, int nofire) {

        this.room = room;
        this.nofire = nofire;
    }

    public Office(int layers, int area, int room, int nofire) {
        super(layers, area);
        this.room = room;
        this.nofire = nofire;
    }

    public void show() {
        System.out.print("写字楼：层数：" + super.getLayers() + ",总面积：" + super.getArea());
        System.out.println("房间数：" + room + ",灭火器数：" + nofire);
    }
}

